#include "StarDict.h"
#include "StarDictImpl.h"
#include <string>

StarDict::StarDict(void):pimpl_(new StarDictImpl)
{
}

StarDict::~StarDict(void)
{
	delete pimpl_;
}


bool StarDict::load(const char* path)
{
	using namespace std;
	if(!pimpl_->load_ifo(string(path)))
		return false;

	if(!pimpl_->load_idx(string(path)))
		return false;

	if(!pimpl_->load_dict(string(path)))
		return false;
	return true;

}

char* StarDict::get_word(size_t index)
{
	return pimpl_->get_word(index);
}

char* StarDict::get_entry(size_t index)
{
	return pimpl_->get_entry(index);
}
